<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="v_container" style="width: 180px; height: 40px"></div>
    <input type="text" id="code_input" value="" placeholder="请输入验证码" />
    <div>
      <button id="my_button">验证</button>
    </div>

    <script src="./JS资源/gVerify.js"></script>
    <script>
      const verifyCode = new GVerify({
        id: 'v_container',
      });
      document.getElementById('my_button').onclick = function () {
        var res = verifyCode.validate(document.getElementById('code_input').value);
        if (res) {
          alert('验证正确');
        } else {
          alert('验证码错误');
        }
      };
    </script>
  </body>
</html>
